import Http from '../utils/http.js'

class LikeModel extends Http{
  like(behavior, art_id, category){
    let url = behavior === 'like' ? '/like': '/like/cancel'
    // let url = behavior === 'like' ? '/latest.json': '/latest.json'
    this.request({
      url: url,
      method: 'POST',
      data: {
        art_id,
        type: category
      }
    })
  }

  getClassicLikeStatus(artId, category, sCallback){
    this.request({
      url: `/classic/${category}/${artId}/favor`,
      success: sCallback
    })
  }
}
export default LikeModel